package com.etc.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.etc.dao.UserMapper;
import com.etc.entity.User;
import com.etc.service.LoginService;
import com.etc.utils.MD5Util;

/**
 * 商家管理员登录的service实现类
 * @author Administrator
 *
 */
@Service(value="loginService")
public class LoginServiceImpl implements LoginService{
	@Resource
	private UserMapper userMapper;
	@Override
	public User userLogin(String utel, String upwd, int ustate) {
		String iupwd= MD5Util.getEncodeByMd5(upwd);
		User user=userMapper.userLogin(utel, iupwd, ustate);
		return user;
	}
	
	@Override
	public User faceLogin(int uid) {
		User user = userMapper.selectByPrimaryKey(uid);
		return user;
	}

}
